package com.mm.domain.note;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 描述: 笔记存储
 *
 * @author: yanglin
 * @Date: 2021-05-12-13:42
 * @Version: 1.0
 */

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("d_note")
public class DNote implements Serializable {

    @TableId(value = "nId", type = IdType.AUTO)
    private Integer nId;

    @TableField("text")
    private String text;

    @TableField("delFlg")
    public Integer delFlg;

    @TableField("createBy")
    public String createBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    @TableField("createTime")
    public Date createTime;

    public DNote(){}

    public DNote(String text, Integer nId) {
        this.nId = nId;
        this.text = text;
    }
}
